package com.company.management.controller.report.rep;

import lombok.Data;

@Data
public class APIResult {
    private Integer code;
    private String msg;
    private Object data;

    public APIResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static APIResult ok(Object data) {
        return new APIResult(200, "Success", data);
    }

    public static APIResult ok() {
        return new APIResult(200, "Success", null);
    }

    public static APIResult fail(String msg) {
        return new APIResult(500, msg, null);
    }
}
